// 配置redux
import { createStore } from 'redux'
// 定义reducer纯函数
const reducer = (state, actions) => {
    if (!state) {
        state = {
            num: 1,
            isLoading: false
        }
    }
    let status=actions.payload
    switch (actions.type) {
        case 'SET_LOADING':
            return {
                ...state,
                isLoading:status
            }
            break;

        default:
            return {
                ...state
            }
    }
}

// 定义对象的值
const store = createStore(reducer)
// 抛出对象
export { store }